# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=svt-hevc
pkgver=1.5.0
pkgrel=0
pkgdesc="Scalable Vector Technology for HEVC encoder (SVT-HEVC Encoder)"
url="https://01.org/svt"
arch="x86_64" # x86 error: incompatible type for argument 2 of '_mm_storel_epi64'
license="BSD-2-Clause-Patent"
options="!check" # No test suite from upstream
makedepends="cmake yasm"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenVisualCloud/SVT-HEVC/archive/v$pkgver.tar.gz"
builddir="$srcdir/SVT-HEVC-$pkgver"

build() {
	mkdir -p build

	cd build

	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS"

	make
}

package() {
	cd build

	make DESTDIR="$pkgdir" install

	cd "$builddir"

	install -Dm 644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="e24c48b05c09f348ff39515b8eaa9723d012157ec395520d21adf5654f4e56082a8d46a9ba8c38ee536e78b59cf48d2eb93fadb6e8416a27541003a08593580c  svt-hevc-1.5.0.tar.gz"
